const KoaRouter = require('koa-router');
const HttpClient = require('../util/HttpClient');
const Template = require('../util/Template')

const router = new KoaRouter();
const modules = require('../../modules');

router.get('/security/trial/view', async ctx => {
    let modConfig = modules['security.trial.view'];
    let reqHeaders = ctx.request.headers;
    let script = ['/security.trial.view.js'];
    let result = await HttpClient.request('/security/trial/view', 'get', null, { headers: reqHeaders });
    let body = result.body;
    ctx.body = await Template.renderWithHtml('售后宝', body, script, modConfig.template, ctx)
})

module.exports = router;